var status;

/**
 * 树
 */
Ext.onReady( function() {
	/**
	 * 状态数据源
	 */
	var statusStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : basePath + 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=getComboBox&paramCount=1&param_0=4'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true
	});
	
	/**
	 * 状态控件
	 */
	var statusComboBox = new Ext.form.ComboBox({
		fieldLabel : '状态',
		id : 'status',
		width : 200,
		displayField : 'CL_NAME',//text id : 'status'
		valueField : 'CL_CODE',//value
		emptyText : '请选择',
		store:statusStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true
	});
	
	var storereader= new Ext.data.JsonReader({
		//为分页增加
//		root : 'results',
//        totalProperty : 'totalCount',
        
    	fields:[
    		{name :'plCode'},
    		{name :'plName'},
    		{name :'status'},
    		{name :'remarked'}
    	]
	});
	
	var store = new Ext.data.Store({
		reader:storereader,
		proxy:new Ext.data.HttpProxy({
			url:basePath + 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=getPropertyType&paramCount=0'
		})
	});
	
//	store.load({
//        params: {
//            param_0: 0,
//            param_1: 20
//        }
//    });
	store.load();
	
	var dataUrl = basePath + 'JarpListener?className=cn.com.zsc.system.GroupManage';

	/*
	 * ddArray中的格式为[nodeCode,pNodeCode_nodePos]保存拖动的操作
	 */
	var ddArray = new Array();
	/** ****************************用于显示分类的树，该树可直接对分类信息进行维护******************** */
	var groupTree = new Ext.tree.TreePanel({
				enableDD : true,
				animate : true,
				id:'groupTree',
				frame : false,
				border : false,
				region : 'center',
				autoScroll : true,
				tbar : ['', {
							iconCls : 'add',
							text : '新增同级',
							handler : function() {
								addequalNode();
							}
						}, '-', {
							iconCls : 'add',
							text : '新增下级',
							handler : function() {
								addNode();
							}
						}, '-', {
							iconCls : 'modify',
							text : '编辑',
							handler : function() {
								editNode();
							}
						}, '-', {
							iconCls : 'delete',
							text : '删除',
							handler : function() {
								delNode();
							}
						}, '-', {
							iconCls : 'save',
							text : '保存配置',
							handler : function() {
								saveNodes();
							}
						}],
				root : new Ext.tree.AsyncTreeNode({
							text : groupType,
							id : '-1'
						}),
				rootVisible : false,
				listeners : {
					'beforeload' : gT_beforeload,
					'click' : gT_click,
					'dblclick' : gT_click,
					'append' : gT_apd,
					'nodedrop' : gT_nodedrop
				}
			});
	function gT_beforeload(node) {
		var pid = '-1';

		if (node.getDepth() != 0) {
			pid = node.attributes.clCode;
		}
		var loadUrl = dataUrl + '&methodName=getGroup&paramCount=2&param_0='
				+ groupType + '&param_1=' + pid;
		node.loader = new Ext.tree.TreeLoader({
					dataUrl : loadUrl
				});
	}
	function gT_apd(tree, tnode, node) {
		if (node.leaf) {
			node.leaf = false;
			node.attributes.leaf = false;
			node.ui.wasLeaf = true;
		}
	}
	function gT_click(node, e) {
		Ext.mytree.resetBoldNodes(groupTree.getRootNode());
		node.getUI().addClass('selitem');
		node.toggle();
	}
	/* 节点放下的时候 */
	function gT_nodedrop(e) {
		var node = e.target;// 目标节点
		var cnode = e.data.node;// 该节点

		var pnode = e.data.node.parentNode;// 父节点
		var nodePos = cnode.previousSibling
				? parseInt(cnode.previousSibling.attributes.sort) + 1
				: '0';// 该节点当前的位置
		var dd = [cnode.id, pnode.id + '_' + nodePos];
		var isHas = false;
		for (var i = 0; i < ddArray.length; i++) {
			if (ddArray[i][0] == cnode.id) {
				ddArray[i] = dd;
				isHas = true;
				break;
			}
		}
		if (!isHas) {
			ddArray.push(dd);
		}
	}
	/* 取消节点的焦点，用与增加节点到根下 */
	function unselect() {
		var eNode = groupTree.getSelectionModel().getSelectedNode();
		if (eNode)
			eNode.unselect();
	}
	/* 保存节点结构 */
	function saveNodes() {
		if (ddArray.length != 0) {
			var saveUrl = dataUrl
					+ '&methodName=saveNodes&paramCount=1&param_0=' + groupType;
			groupTree.body.mask('正在保存配置...', 'x-mask-loading');
			Ext.http.send(saveUrl, function(resText) {
				if (resText == 'success') {
					Ext.Msg
							.alert('提示',
									'&nbsp;&nbsp;&nbsp;&nbsp;保存成功&nbsp;&nbsp;&nbsp;&nbsp;');
					groupTree.root.reload();
				} else {
					Ext.Msg.alert('提示', '保存失败:' + resText);
				}
				groupTree.body.unmask();
			}, Ext.encode(ddArray));

		} else {
			Ext.Msg.alert('提示', '在树节点顺序变换时才需保存，当前节点顺序没有改变，保存终止');
		}
	}
	/* 新增一个节点 */
	function addNode() {
		propW.flg = '0';
		propW.setTitle('新增下级');
		propW.show();
	}
	function addequalNode() {
		var record = groupTree.getSelectionModel().getSelectedNode();
		if (!record) {
			Ext.Msg.alert("提示", "没有选择节点，请选择要新增的级别");
			return;
		}
		propW.flg = '3';
		propW.setTitle('新增同级');
		propW.show();
	}
	/* 修改指定节点 */
	function editNode() {
		propW.flg = '1';
		var eNode = groupTree.getSelectionModel().getSelectedNode();
		if (eNode) {
			Ext.getCmp('inputText').setValue(eNode.text);
			Ext.getCmp('inputRemarked').setValue(eNode.attributes.remarked);
			Ext.getCmp('inputParm').setValue(eNode.attributes.parm);
			propW.setTitle('编辑');
			propW.show();
		} else {
			Ext.Msg.alert('提示', '请选择要修改的节点');
		}
	}
	/* 删除指定节点 */
	function delNode() {
		var thisNode = groupTree.getSelectionModel().getSelectedNode();
		if (thisNode) {
			if (thisNode.ui.wasLeaf) {
				Ext.Msg.show({
							title : '提示',
							msg : '删除分类可能导致分类下的数据丢失，确定要删除该分类？',
							buttons : Ext.Msg.YESNO,
							fn : function(btn) {
								if (btn == "yes") {
									delCurNode(thisNode);
								}
							}
						});
			} else {
				Ext.Msg.show({
					title : '提示',
					msg : '分类包含子分类，该操作仅关联删除下一级分类，若有多级子分类请手动删除后在删除此分类，并且删除分类可能导致分类下的数据丢失，确定要删除？',
					buttons : Ext.Msg.YESNO,
					fn : function(btn) {
						if (btn == "yes") {
							delCurNode(thisNode);
						}
					}
				});
			}
		} else {
			Ext.Msg.alert('提示', '请选择要删除的分类节点');
		}
	}
	function delCurNode(thisNode) {
		var delUrl = dataUrl + '&methodName=delGroup&paramCount=0';
		var delOb = {
			ccode : thisNode.attributes.clCode
			// cid : groupType,
			// code : thisNode.id
		}
		groupTree.body.mask('正在删除节点...', 'x-mask-loading');
		Ext.http.send(delUrl, function(resText) {
					if (resText == 'success') {
						thisNode.remove();
					} else {
						Ext.Msg.alert('提示', '删除失败:' + resText);
					}
					groupTree.body.unmask();
				}, Ext.encode(delOb));
	}
	/* 改变节点图标状态为文件夹状态，即有子节点状态 */
	function changeIcn(node) {
		node.leaf = false;
		node.ui.wasLeaf = false;
		node.attributes.leaf = false;
	}
	/** **********************用于新增，修改节点的window************************************* */
	var propW = new Ext.Window({
		bodyStyle : 'padding:25px 35px 0',
		width : 360,
		height : 270,
		title : '',
		layout : 'form',
		closeAction : 'hide',
		modal : true,
		labelWidth : 60,
		// draggable:false,
		// resizable:false,
		items : [{
					xtype : 'textfield',
					id : 'inputText',
					fieldLabel : '名称',
					name : 'inputText',
					maxLength : 30,
					maxLengthText : '名称过长，请保持在30个字符以内',
					width : 200
				}, {
					xtype : 'textfield',
					id : 'inputParm',
					fieldLabel : '  参数',
					name : 'inputParm',
					maxLength : 30,
					maxLengthText : '参数信息过长，请保持在30个字符以内',
					width : 200
				}, {
					xtype : 'textarea',
					id : 'inputRemarked',
					fieldLabel : '  备注',
					name : 'inputRemarked',
					maxLength : 100,
					maxLengthText : '备注信息过长，请保持在30个字符以内',
					width : 200,
					height : 100
				}],
		tbar : ['', {
			text : '保存',
			iconCls : 'save',
			handler : function() {
				// 增加节点
				if (propW.flg == '0') {
					var text = Ext.getCmp('inputText').getValue();
					var remarked = Ext.getCmp('inputRemarked').getValue();
					var parm = Ext.getCmp('inputParm').getValue();

					if (Ext.util.Format.trim(text).length == 0) {
						Ext.getCmp('inputText').markInvalid('名称不能为空!');
						return false;
					} else if (Ext.util.Format.trim(text).length > 30) {
						Ext.getCmp('inputText').markInvalid('名称过长，请保持在30个字符以内');
						return false;
					}
					var node = new Ext.tree.AsyncTreeNode({
								text : text,
								remarked : remarked,
								leaf : true
							});
					var pNode = groupTree.getSelectionModel().getSelectedNode();

					if (pNode) {
						pNode.appendChild(node);
						pNode.expand();
					} else {
						pNode = groupTree.root;
						pNode.appendChild(node);
					}
					// 该次操作的数据，将被保存于obj中传递到后台
					var sendObj = {
						cid : groupType,
						pid : pNode.id,
						preid : node.previousSibling
								? node.previousSibling.id
								: '0',
						text : node.text,
						remarked : remarked,
						parm : parm
					}
					var addUrl = dataUrl + '&methodName=addGroup&paramCount=0';
					groupTree.body.mask('正在新增节点...', 'x-mask-loading');
					Ext.http.send(addUrl, function(resText) {
								if (resText == 'success') {
									groupTree.root.reload();
								} else {
									pNode.removeChild(node);
									Ext.Msg.alert('提示', '新增节点失败：' + resText);
								}
								groupTree.body.unmask();
							}, Ext.encode(sendObj));

				} else if (propW.flg == '3') {// 新增同级
					var text = Ext.getCmp('inputText').getValue();
					var remarked = Ext.getCmp('inputRemarked').getValue();
					var parm = Ext.getCmp('inputParm').getValue();
					if (Ext.util.Format.trim(text).length == 0) {
						Ext.getCmp('inputText').markInvalid('名称不能为空!');
						return false;
					} else if (Ext.util.Format.trim(text).length > 30) {
						Ext.getCmp('inputText').markInvalid('名称过长，请保持在30个字符以内');
						return false;
					}
					var node = new Ext.tree.AsyncTreeNode({
								text : text,
								leaf : true
							});
					var pNode = groupTree.getSelectionModel().getSelectedNode().parentNode;
					var preida = pNode.lastChild.id;
					if (pNode) {
						pNode.appendChild(node);
						pNode.expand();
					} else {
						pNode = groupTree.root;
						pNode.appendChild(node);
					}
					// 该次操作的数据，将被保存于obj中传递到后台
					var sendObj = {
						cid : groupType,
						pid : pNode.id,
						text : node.text,
						parm : parm,
						remarked : remarked
					}
					var addUrl = dataUrl + '&methodName=addGroup&paramCount=0';
					groupTree.body.mask('正在新增节点...', 'x-mask-loading');
					Ext.http.send(addUrl, function(resText) {
								if (resText == 'success') {
									groupTree.root.reload();
								} else {
									pNode.removeChild(node);
									Ext.Msg.alert('提示', '新增节点失败：' + resText);
								}
								groupTree.body.unmask();
							}, Ext.encode(sendObj));
				}// 修改节点
				else if (propW.flg == '1') {
					var eNode = groupTree.getSelectionModel().getSelectedNode();

					if (eNode) {
						var text = Ext.getCmp('inputText').getValue();
						var remarked = Ext.getCmp('inputRemarked').getValue();
						var parm = Ext.getCmp('inputParm').getValue();
						if (Ext.util.Format.trim(text).length == 0) {
							Ext.getCmp('inputText').markInvalid('名称不能为空!');
							return false;
						}

						var editUrl = dataUrl
								+ '&methodName=updateGroup&paramCount=0';
						var editOb = {
							remarked : remarked,
							ccode : eNode.attributes.clCode,
							text : text,
							parm : parm
						};
						groupTree.body.mask('正在编辑节点...', 'x-mask-loading');
						Ext.http.send(editUrl, function(resText) {
									if (resText == 'success')
										groupTree.root.reload();
									else
										Ext.Msg
												.alert('提示', '修改节点失败:'
																+ resText);
									groupTree.body.unmask();
								}, Ext.encode(editOb));

					} else {
						Ext.Msg.alert('提示', '请选择要修改的节点');
					}
				}
				propW.hide();
			}
		}]
	});
	propW.on('hide', function() {
				Ext.getCmp('inputText').setValue('');
				Ext.getCmp('inputRemarked').setValue('');
				Ext.getCmp('inputParm').setValue('');
			});
	
//	var toolpanel = new Ext.PagingToolbar({
//                    pageSize:20,
//                    store:store,
//                    storeParams : {
//                            className : 'cn.com.zsc.system.SelectPropertyType',
//                            methodName : 'getPropertyType',
//                            paramCount : '2',
//                            param_0 : '0',
//                            param_1 : '20'
//                        },
//                        paramNames : {
//                            start : 'param_0',
//                            limit : 'param_1'
//                        },
//                    displayInfo: true,
//                    displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
//                    emptyMsg: '没有记录'
//                });
				
	var basegrid = new Ext.grid.GridPanel( {
		id :'basegrid',
		width:500,
		store :store,
		split :true,
		bodyStyle:'5px 15px 0',
		region :'west',
		border :false,
		enableColumnMove:false,                                           
	  	enableHdMenu:false,
		frame :false,
		autoScroll :true,
		viewConfig: {
        	forceFit: true
    	},
    	columns: [
		            new Ext.grid.RowNumberer(),
    	          	{id:'plCode',name:'plCode', header:'编号',enableColumnMove:false,sortable:true,hidden:true,hideCollapseTool:false, enableHdMenu:false,enableColumnResize :false,dataIndex: 'plCode'},
    	          	{id:'plName',name:'plName', header:'名称',sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'plName'},
                    {
                   	 header :'状态',
               		 sortable : true,
               		 locked : false,
               		 dataIndex:'status',
               		 renderer:function (val){
                                    if (val == '1'){
                                        return '启用';
                                    }else{
                                        return '停用';
                                    }
                                }
           			 } ,
    	          	{id:'remarked',name:'remarked',header:'备注',sortable:true,hidden:false,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false,dataIndex: 'remarked'}
    	],
    	tbar:[
	    	     {
		    	     text:'新增',
		    	     iconCls:'add',
		      	   	 handler:function(){
		      	   	 	status=1;
		      	   	 	win.setTitle("新增字典");
		      	   	 	win.show();
		      	   	 	Ext.Ajax.request({
		      	   	 		url:basePath + 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=getPropertyType&&paramCount=0',
		      	   	 		success:function(req){
		      	   	 			Ext.getCmp("plCode").setValue(req.responseText);
		      	   	 		},
		      	   	 		failure:function(req){
		      	   	 		}
		      	   	 	});
						Ext.getCmp("plName").setValue("");
						Ext.getCmp("status").setValue("");
						Ext.getCmp("remarked").setValue("");
		    	     }
	      	   	},
	      	   	'-',
	      	   	{
		      	   	text:'修改',
		      	   	iconCls:'modify',
		      	   	handler:function(){
	      	   		status=2;
	      	   		var record = basegrid.getSelectionModel().getSelected(); 
	   		        if(!record){   
			   		   Ext.Msg.show({   
			   		     title: '提示',
			   		     width:210,
			   		     msg: '请选择要修改的数据！',   
			   		     buttons : Ext.Msg.OK,   
			   		     icon : Ext.Msg.ERROR   
			   		    });      
		      	   	}else{
			      	   	if(record){   
		            	   	win.show();
		            	   	win.setTitle("修改字典");
		            	   	var record = basegrid.getSelectionModel().getSelected();
							Ext.getCmp("plCode").setValue(record.data.plCode);
							Ext.getCmp("plName").setValue(record.data.plName);
							
							Ext.getCmp("status").setValue(record.data.status);
							Ext.getCmp("remarked").setValue(record.data.remarked);
			              }     
		      	   		}
	      	   		}
	      	   	},
	      	   	'-',
	      	   	{
		      	   	text:'删除',
		      	   	iconCls:'delete',
		      	   	handler:del
	      	   	}
	      	   	
 	  ],
// 	  bbar:toolpanel,
 	  listeners : {'rowclick' : changeRightTree}
	});
	
	function changeRightTree(grid, index, event) {
		groupTree.body.mask('树节点正在展开，请稍后操作', 'x-mask-loading');
		var record = grid.getSelectionModel().getSelected();
		groupType = record.data.plCode;
		groupTree.root.reload();
		groupTree.body.unmask();
	}
	
	var formPanel = new Ext.FormPanel({
		bodyStyle:'padding:15px 15px 0',
		region:'center',
		layout:'form',
		frame:true,
		labelWidth:60,
		labelAlign:'right',
		items:[
		
		       {fieldLabel: '编号',width:200,name: 'plCode',id:'plCode',xtype:'textfield',hideLabel:true,hidden:true},
		       {fieldLabel: '名称',width:200,name: 'plName',id:'plName',xtype:'textfield'},
			   statusComboBox,
		       {fieldLabel: '备注',width:200,height:80,name: 'remarked',id:'remarked',xtype:'textarea'}		       
		]
	});
	
	var win = new Ext.Window({
		title:'新增',
		width:350,
		height:250,
		layout:'border',
		closeAction:'hide',
		modal:true,
		draggable:false,
		resizable:false,
		tbar:[
		      {
		    	  text:'保存',
		    	  iconCls:'save',
		    	  handler:judge
		      },
		      '-'
		      ,
		      {
		    	  text:'取消',
		    	  iconCls:'cancel',
		    	  handler:function(){
      	   			win.hide();
		      	  }
		      }
		],
		items:[formPanel]
		
	});
	
	/**
	 * 用户树Panel
	 */
	var leftPanel = new Ext.Panel( {
		id:'leftPanel',
		border:true,
		region:'west',
		width:200,
		split:true,
		collapsible:false,
		items:[basegrid]
	});
		
	var viewport = new Ext.Viewport( {
		layout :'border',
		items : [basegrid, groupTree]
	});
	
	function judge() {
		if (status == 1) {
			save();
		} else if (status == 2) {
			update();
		}
	}

	function save() {
		if (!saveValidate()) {
			return;
		}
		var obj = new Object();
		obj.plName = Ext.getCmp("plName").getValue();
		obj.status = Ext.getCmp("status").getValue();
		obj.remarked = Ext.getCmp("remarked").getValue();

		var url = 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=insertProptype&paramCount=0'
		httpReq = null;
		httpReq = getXMLHttpRequest();
		httpReq.onreadystatechange = onSaveRtn;
		httpReq.open("POST", url, true);
		httpReq.send(Ext.util.JSON.encode(obj));
	}

	function saveValidate() {
		if (Ext.getCmp("plName").getValue() == "") {
			Ext.getCmp("plName").markInvalid("名称不能为空");
			return false;
		}
		return true;
	}

	function onSaveRtn() {
		if (httpReq.readyState == 4) {
			if (httpReq.status == 200) {
				if (httpReq.responseText == "success") {
					Ext.Msg.show({
								title : '成功提示',
								width:200,
								msg : '保存成功！',
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.INFO
							});
					store.reload();
					Ext.getCmp("plCode").setValue("");
					Ext.getCmp("plName").setValue("");
					Ext.getCmp("status").setValue("");
					Ext.getCmp("remarked").setValue("");
					win.hide();
					httpReq = null;
				} else {
					Ext.Msg.show({
								title : '错误提示',
								width:200,
								msg : httpReq.responseText,
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.ERROR
							});
					httpReq = null;
				}
			}
		}
	}

	function del() {
		var record = basegrid.getSelectionModel().getSelected();
		if (!record) {
			Ext.Msg.show({
						title : '提示',
						width:210,
						msg : '请选择要删除的数据',
						buttons : Ext.Msg.OK,
						icon : Ext.Msg.ERROR
					});
		}
		if (record) {
			Ext.Msg.show({
						title : '提示',
						width:200,
						msg : '确定要删除数据！',
						buttons : Ext.Msg.YESNO,
						icon : Ext.MessageBox.QUESTION,
						fn : function(btn) {
							if ("yes" == btn) {
								delProc()
							}
						}
					});

		}

	}

	function delProc() {
		var record = basegrid.getSelectionModel().getSelected();
		var obj = new Object();
		obj.plCode = record.data.plCode;
		var url = 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=delPropType&paramCount=0'
		httpReq = null;
		httpReq = getXMLHttpRequest();
		httpReq.onreadystatechange = onDelRtn;
		httpReq.open("POST", url, true);
		httpReq.send(Ext.util.JSON.encode(obj));
	}

	function onDelRtn() {
		if (httpReq.readyState == 4) {
			if (httpReq.status == 200) {
				if (httpReq.responseText == "success") {
					Ext.Msg.show({
								title : '成功提示',
								width:200,
								msg : '删除成功！',
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.INFO
							});
					store.reload();
					Ext.getCmp("plCode").setValue("");
					httpReq = null;
					groupTree.root.reload();
				} else {
					Ext.Msg.show({
								title : '错误提示',
								width:200,
								msg :httpReq.responseText,
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.ERROR
							});
					httpReq = null;
				}
			}
		}
	}

	function update() {
		if (!saveValidate()) {
			return;
		}
		var obj = new Object();
		var record = basegrid.getSelectionModel().getSelected();
		obj.plCode = Ext.getCmp("plCode").getValue();
		obj.plName = Ext.getCmp("plName").getValue();
		obj.status = Ext.getCmp("status").getValue();
		obj.remarked = Ext.getCmp("remarked").getValue();
		var url = 'JarpListener?className=cn.com.zsc.system.SelectPropertyType&methodName=updateType&paramCount=0'
		httpReq = null;
		httpReq = getXMLHttpRequest();
		httpReq.onreadystatechange = onUpdateRtn;
		httpReq.open("POST", url, true);
		httpReq.send(Ext.util.JSON.encode(obj));
	}

	function onUpdateRtn() {
		if (httpReq.readyState == 4) {
			if (httpReq.status == 200) {
				if (httpReq.responseText == "success") {
					Ext.Msg.show({
								title : '成功提示',
								width:200,
								msg : '保存成功！',
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.INFO
							});
					store.reload();
					Ext.getCmp("plCode").setValue("");
					Ext.getCmp("plName").setValue("");
					Ext.getCmp("status").setValue("");
					Ext.getCmp("remarked").setValue("");
					win.hide();
					httpReq = null;
				} else {
					Ext.Msg.show({
								title : '错误提示',
								width:200,
								msg : httpReq.responseText,
								buttons : Ext.Msg.OK,
								icon : Ext.Msg.ERROR
							});
					httpReq = null;
				}
			}
		}
	}
	
	
});